package io.gitee.yxsnake.framework.translation.core.impl;

import io.gitee.yxsnake.framework.core.utils.ResultUtils;
import io.gitee.yxsnake.framework.system.api.RemoteDeptService;
import io.gitee.yxsnake.framework.translation.annotation.TranslationType;
import io.gitee.yxsnake.framework.translation.constant.TransConstant;
import io.gitee.yxsnake.framework.translation.core.TranslationInterface;
import jakarta.annotation.Resource;
import lombok.AllArgsConstructor;

/**
 * @author snake
 * @description 部门翻译实现
 * @since 2024/11/3 13:59
 */
@AllArgsConstructor
@TranslationType(type = TransConstant.DEPT_ID_TO_NAME)
public class DeptNameTranslationImpl implements TranslationInterface<String> {

    @Resource
    private RemoteDeptService remoteDeptService;

    @Override
    public String translation(Object key, String other) {
        return ResultUtils.getResultData(remoteDeptService.selectDeptNameByIds(key.toString()));
    }
}